<?php 
include_once("../../../configuracion/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/plantillaAdmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Nueva Dependencia</title>
<!-- InstanceEndEditable -->
<link rel="stylesheet" type="text/css" href="../../css/estilo.css"/>
<link rel="stylesheet" type="text/css" href="../../css/sortableTable.css"/>
<link rel="SHORTCUT ICON" href="../../../logo/unc.ico"/>
<!-- InstanceBeginEditable name="head" -->
<link rel="stylesheet" type="text/css" href="../../css/DatePicker.css"/>
<script type="text/javascript" src="../../js/mootools.js"></script>
<script type="text/javascript" src="../../js/iToolkit.js"></script>
<script type="text/javascript" src="../../js/DatePicker.js"></script>
<script type="text/javascript" src="../../js/sortableTable.js"></script>
<script type="text/javascript" src="../../js/form_abm.js"></script>
<script type="text/javascript" src="../../js/fValidator-full.js"></script>
<link rel="stylesheet" href="../../css/Autocompleter.css" type="text/css" media="screen"/>
<script type="text/javascript" src="../../js/Observer.js"></script>
<script type="text/javascript" src="../../js/Autocompleter.js"></script>

<script>




function funcionFila(){
	 fila = this.id;
	 var miJSON = new Json.Remote("ajax.form/dependencia_datos.php",	{
	//la peticion nos devolvera un objeto el cual llegara como parametro en el evento onComplete
	onComplete: function(objevento){
			  $('iddependencia').value = objevento.iddependencia;
		      $('descripcion').value = objevento.descripcion;
		      $('idUniversidad').value = objevento.idUniversidad;
		      $('universidad').value = objevento.universidad;
		      $('actualizar').disabled = false;
		      $('eliminar').disabled = false;
		    }
	});	
       miJSON.send(fila);
}
	
window.addEvent('domready', function(){
	myTable = new sortableTable('myTable', 
								{overCls: 'over', 
								 onClick: funcionFila
								});

	myForm = new form_abm('formabm',
							 {accion:'ajax.form/dependencia_add.php',nombre:'guardar',capa:'log_res_ajax'} ,
							 {accion: 'ajax.form/dependencia_del.php',nombre:'eliminar',capa:'log_res_ajax'},
							 {accion:'ajax.form/dependencia_edit.php',nombre:'actualizar',capa:'log_res_ajax'},
							 ['descripcion','universidad'],myTable
							 )

}); 


</script>



<!-- InstanceEndEditable -->

</head>

<body>

<?php include('../estructura/encabezado.php');?>
<div class="menuIzqquierdo">

<?php include('../menu/menuIzq.html');?>

</div>
<div class="content"><!-- InstanceBeginEditable name="EditRegion3" -->
<div id="ajax_bar">
<h2>Dependencia</h2>
	<form id="formabm"   method="post" class="fValidator-form"  name="formabm">
	<?php include_once("int_dependencia.php"); ?>

	       
	      	 <input id="guardar" class="fValidator-form" type="button"  value="Nuevo" name="guardar"/>	
     <input id="actualizar" class="fValidator-form" type="button"   value="Actualizar " name="actualizar" disabled="disabled"/>	
      <input id="eliminar" class="fValidator-form" type="button"    value="Eliminar" name="eliminar" disabled="disabled"/>	

	 </form>
</div>
<div id="info">

		<div id="log_res_ajax"><!-- spanner --></div>
		<?php include_once("dependencia_list.php");?>
</div>

<!-- InstanceEndEditable --></div>
<?php include('../estructura/pie.php');?>
</body>
<!-- InstanceEnd --></html>
 